<?php
class Parameters {
	public static function getParameterValue($paramId) {
		$db = new DbConnection();
		$db->getConnection();
		$query = sprintf("SELECT VALUE FROM params WHERE ParamId = '%u' AND Status = '1'", $paramId);
		$result = $db->executeQuery($query);		
		
		if (!$result) {
		    echo 'Could not run query: ' . mysql_error();
		    return;
		}
		
		$row = mysql_fetch_row($result);
		$template = $row[0];
		
		mysql_free_result($result);
		
		return $value;
	}		
	
	public static function setParameterValue($paramId, $value) {
		$db = new DbConnection();
		$db->getConnection();
		$query = sprintf("UPDATE params SET Value = '%d' WHERE ParamId = '%u' AND Status = '1'", $value, $paramId);
		$result = $db->executeQuery($query);		
		
		if (!$result) {
		    echo 'Could not run query: ' . mysql_error();
		}
	}
}
?>